package com.epam.parser;

import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class Sentence extends TextPart {

	public Sentence(String s) {
		super(s);
	}

	public Sentence() {
		
	}

	public static List<TextPart> divideToSentences(List<TextPart> text) {
		String t = listToString(text);
		List<TextPart> sentences = new ArrayList<TextPart>();

		StringTokenizer sentenceTokenizer = new StringTokenizer(t, ".");
		while (sentenceTokenizer.hasMoreTokens()) {
			sentences.add(new Sentence(sentenceTokenizer.nextToken()));
		}
		return sentences;

	}
}
